import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/admin/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/api/admin/info',
    method: 'get',
    params: { token }
  })
}

export function fetchUserMenuList(token) {
  return request({
    url: '/api/menu/get_list',
    method: 'get',
    params: { token }
  })
}

export function logout(token) {
  return request({
    url: '/api/admin/logout',
    method: 'post',
    params: { token }
  })
}


export function getList(query) {
  return request({
    url: '/api/admin/admin_list',
    method: 'get',
    params: query
  })
}


export function planid_history(query) {
  return request({
    url: '/api/order/planid_history',
    method: 'get',
    params: query
  })
}


export function create(data) {
  return request({
    url: '/api/admin/create',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/api/admin/delete',
    method: 'get',
    params: { id }
  })
}
